﻿using System;

namespace CollegeSim.CourseScheduler.Domain.Entities
{
    // Author: Ryan Redburn
    // Project: Course Scheduler
    // Date: 2/4/2014

    public class Instructor : Person
    {
        #region [ Fields ]

        private string _officeNumber;

        #endregion

        #region [ Properties ]

        // Instructor OfficeNumber
        // Format: PS104
        public string OfficeNumber
        {
            get { return _officeNumber; }
            set
            {
                if (value == null || value.Length == 5)
                {
                    _officeNumber = value;    
                }
                else
                {
                    throw new ArgumentOutOfRangeException("value", "OfficeNumber must be five characters in length.");
                }
            }
        }

        #endregion

        #region [ Methods ]

        // Returns name and phonenumber
        // Format: LastName, FirstName - PhoneNumber
        public override string ToString()
        {
            return LastName + ", " + FirstName + " - " + PhoneNumber;
        }

        #endregion
    }
}
